var Handler = function(){
}
/**
 * add(object, event, handler)
 *
 * register EventHandler for elements
 * uses addEventListener for normal browsers and  attachEvent for ie
 * @param Element 'object'
 * @param string 'event' (for attachEvent it adds 'on')
 * @param function 'handler'
 */
Handler.prototype.add = function (object, event, handler)
{  
  if (typeof object.addEventListener != 'undefined'){
    object.addEventListener(event, handler, false);
  }else if (typeof object.attachEvent != 'undefined'){
    object.attachEvent('on' + event, handler);
  }else{
    throw "Incompatible browser";
  }
}

/**
 * remove(object, event, handler)
 * 
 * remove EventHandler for elements
 * uses removeEventListener for normal browsers and  detachEvent for ie
 * @param Element 'object'
 * @param string 'event' (for detachEvent it adds 'on')
 * @param function 'handler'
 */
Handler.prototype.remove = function (object, event, handler)
{
  if (typeof object.removeEventListener != 'undefined')
    object.removeEventListener(event, handler, false);
  else if (typeof object.detachEvent != 'undefined')
    object.detachEvent('on' + event, handler);
  else
    throw "Incompatible browser";
}